﻿CREATE TABLE [dbo].[RutasCooperativa](
	[id_ruta_coop] [int] IDENTITY(1,1) NOT NULL,
	[id_rut] [int] NULL,
	[id_coop] [int] NULL,
 CONSTRAINT [PK_RutasCooperativa] PRIMARY KEY CLUSTERED 
(
	[id_ruta_coop] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  ForeignKey [FK_RutasCooperativa_Cooperativa]    Script Date: 11/12/2012 16:56:59 ******/
ALTER TABLE [dbo].[RutasCooperativa]  WITH CHECK ADD  CONSTRAINT [FK_RutasCooperativa_Cooperativa] FOREIGN KEY([id_coop])
REFERENCES [dbo].[Cooperativa] ([id_coop])
GO

ALTER TABLE [dbo].[RutasCooperativa] CHECK CONSTRAINT [FK_RutasCooperativa_Cooperativa]
GO
/****** Object:  ForeignKey [FK_RutasCooperativa_Rutas]    Script Date: 11/12/2012 16:56:59 ******/
ALTER TABLE [dbo].[RutasCooperativa]  WITH CHECK ADD  CONSTRAINT [FK_RutasCooperativa_Rutas] FOREIGN KEY([id_rut])
REFERENCES [dbo].[Rutas] ([id_rutas])
GO

ALTER TABLE [dbo].[RutasCooperativa] CHECK CONSTRAINT [FK_RutasCooperativa_Rutas]